<template>
    <div class="dialog">
        <div class="dialog-con firstAudit">
            <div class="firstAuditTitle">审批</div>
            <div class="opinion">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                    <el-form-item label="审批意见" prop="memo">
                        <el-input type="textarea" v-model="ruleForm.memo"></el-input>
                    </el-form-item>
                    <el-form-item label="审批结果" prop="approveState">
                        <el-select v-model="ruleForm.approveState" placeholder="请选择">
                            <el-option
                            v-for="item in auditResult"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item class="btnAudit">
                        <el-button type="primary" @click="submitForm('ruleForm')" size="medium">提交</el-button>
                        <el-button @click="cancelAudit" size="medium">取消</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
import {localStorage} from "js/localStorage"
import api from 'js/service'
export default {
    data(){
        return{
            ruleForm:{
                memo:'',
                approveState:''
            },
            auditResult:[
                {value:'1',label:'通过'},
                {value:'2',label:'驳回'},
            ],
            rules:{
                memo: [
                    { required: true, message: '请输入审批意见', trigger: 'change' }
                ],
                approveState:[
                    {require:true,message:'请选择审批结果',trigger:'change'}
                ]
            },
            userId:'',
            purBillsId:'',
            purBillsType:'',
        }
    },
    created(){
        this.userId = localStorage.get('userID')
    },
    mounted(){
    },
    methods:{
        cancelAudit(){
            this.$emit('closeTip')
        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.confirmAudit()
                } else {
                    return false;
                }
            });
        },
        confirmAudit(){
           
           
        }
    }
}
</script>
<style lang="scss" scoped>
.firstAudit{
    width:450px;
    height:400px;
    .firstAuditTitle{
        line-height:50px;
        width:100%;
        text-align:center;
        background:#eee;
        // color:#fff;
        font-size:16px;
    }
    .opinion{
        padding-top:20px;
        .el-form-item{
            width:84%;
        }
        .el-select{
            width:280px;
        }
        .btnAudit{
            text-align: center;
            margin-top:120px;
            button{
                margin: 0  10px;
            }
        }
    }
}
</style>
